package com.uzai.console.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.md.mdrobotcmd.MdRobotCmdQuery;
import com.uzai.console.entity.MdRobotCmd;
import com.uzai.console.entity.RobotCmd;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public interface MdRobotCmdMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int deleteByKey(@Param("merId") Long merId, @Param("activityId") Long activityId,  @Param("key") String key);

    int deleteByActivityId(@Param("activityId") Long activityId, @Param("merId") Long merId);

    int insert(MdRobotCmd record);

    int insertSelective(MdRobotCmd record);

    MdRobotCmd selectById(Long id);

    MdRobotCmd selectByMerIdAndVal(@Param("merId") Long merId, @Param("val") String val);

    int updateByIdSelective(MdRobotCmd record);

    int updateById(MdRobotCmd record);

    List<MdRobotCmd> selectByActivityId(@Param("activityId") Long activityId, @Param("merId") Long merId);

    List<MdRobotCmd> selectByMerId(@Param("merId") Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<MdRobotCmd> findByList(Page<MdRobotCmd> page, @Param("query") MdRobotCmdQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<MdRobotCmd> findByList(@Param("query") MdRobotCmdQuery query);

    /**
     * 批量添加
     * @param list
     * @return
     * @return
     */
    int batchAdd(List<MdRobotCmd> list);

    /**
     * 批量删除
     * @param list
     * @return
     */
    int batchDelete(List<Long> list);
}